<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="./font/iconfont.css">
</head>
<style>
    *{
        padding: 0;
        margin: 0;
    }
    html,body{
        height: 100%;
 
    }
    img{
        width: 90px;
        height: 90px;
    }
    .item{
        display: flex;
        justify-content: center;
        margin-bottom: 15px;
    }
    .right{
        display: flex;
        justify-content: space-between;
        width: 50px;
       margin-left: 50px;
       margin-top: 74px;
    }
    .iconfont{
        font-size: 20px;
        margin-left: 5px;
        margin-right: 5px;
    }
    .box{
        display: flex;
        justify-content: space-between;
        margin-bottom: 20px;
    }
    footer{
        height: 71px;
        background-color: gray;
        position: fixed;
        top: 90%;
        left: 0;
        width: 100%;
        
        
    }
</style>

<body>
    <div id="res" style="overflow: atuo; flex: 1;">
        <div class="box">
            <span style="font-size: 20px; margin-left: 20px;">已选商品</span>
            <span class="iconfont icon-shanchu" style="margin-right: 10px;" @click="shan">清空</span>
        </div>
        <div class="box1">
            <div class="item" v-for="(item,index) in tasklist" v-bind:key="index">
                <div class="banner">
                    <img v-bind:src="item.pic" alt="">
                </div>
                <div class="flsh" style="margin-left: 5px;">
                    <div class="name" style="width: 136px;">{{item.name}}</div>
                    <div class="dasc" style="color: red;margin-top: 50px;">{{item.dasc}}<span style="font-size:13px ; color: gray;text-decoration: line-through;">{{item.num}}</span></div>
                </div>
                <div class="right">
                    <div class="iconfont icon-jianshao" @click="jian(item)"></div>
                    <span>{{item.stat}}</span>
                    <div class="iconfont icon-zengjia" @click="jia(item)"></div>
                </div>
            </div>
           
        </div>
       
    </div>
    <footer><span style="margin-left: 120px;">总价</span><button style="width: 100px;height: 40px;border-radius: 5px;margin-left: 270px;margin-top: 5px;background-color: yellowgreen;color: white;">去结算</button></footer>
</body>

</html>
<script src="./vue-2.5.21.js"></script>
<script>
    var V = new Vue({
        el: '#res',
        data: {
            tasklist: [
                { id: 1, pic: './images/pic2.jpg', name: '秋刀鱼/斤', dasc: '￥35.00', num: '￥35', stat: 1 },
                { id: 2, pic: './images/pic2.jpg', name: '鲜大带鱼/条', dasc: '￥45.00', num: '￥45', stat: 1 },
                { id: 3, pic: './images/pic2.jpg', name: '鲜活全母皮皮虾/斤', dasc: '￥85.00', num: '￥85', stat: 1 },
                { id: 4, pic: './images/pic2.jpg', name: '13-15头鲍鱼/只', dasc: '￥35.00', num: '￥35', stat: 1 },
                { id: 5, pic: './images/pic2.jpg', name: '鲜活全母皮皮虾/斤', dasc: '￥85.00', num: '￥85', stat: 1 },
                { id: 6, pic: './images/pic2.jpg', name: '13-15头鲍鱼/只', dasc: '￥35.00', num: '￥35', stat: 1 },
                { id: 7, pic: './images/pic2.jpg', name: '鲜活全母皮皮虾/斤', dasc: '￥85.00', num: '￥85', stat: 1 },
                { id: 8, pic: './images/pic2.jpg', name: '13-15头鲍鱼/只', dasc: '￥35.00', num: '￥35', stat: 1 },
                { id: 9, pic: './images/pic2.jpg', name: '金龙鱼/斤', dasc: '￥555.00', num: '￥555', stat: 1 },
                { id: 10, pic: './images/pic2.jpg', name: '金龙鱼/斤', dasc: '￥555.00', num: '￥555', stat: 1 },
                { id: 11, pic: './images/pic2.jpg', name: '金龙鱼/斤', dasc: '￥555.00', num: '￥555', stat: 1 }
            ],
           
            

        },
        methods:{
            jian(item){
                item.stat--
               if(item.stat<1){
                item.stat=1

               }
            },
            jia(item){
                item.stat++
                if(item.stat>5){
                    item.stat=5
                }

            },
            shan(){
             this.tasklist=''
            }
                                               
        },
        computed:{
            getone(){
                return 
            }
        }
        
    })
</script>